﻿using AutofacDemo1.Services;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace AutofacDemo1.Controllers
{
    [ApiController]
    [Route("home")]
    public class HomeController:ControllerBase
    {
        private readonly IMyService _myService;
        private readonly IUserService _userService;
        public HomeController(IMyService myService
            , IUserService userService)
        {
            this._myService = myService;
            this._userService = userService;
        }

        [HttpGet("sayHi/{name}")]
        public string SayHi([FromRoute]string name)
        {
            return _myService.SayHi(name);
        }


        [HttpGet("hello")]
        public string Hello()
        {
            return _userService.Hello();
        }
    }
}
